Skip to content

Improve auth session persistence#3790

Merged
idoshamun merged 1 commit intomainfrom
codex/auth-session-persistence-fixes
Apr 13, 2026
Merged

Improve auth session persistence#3790
idoshamun merged 1 commit intomainfrom
codex/auth-session-persistence-fixes

Conversation

@idoshamun
Copy link
Copy Markdown
Member

Summary

  • extend Better Auth sessions and cookie metadata to 30 days
  • remove the boot flow edge case where a still-valid JWT near expiry could fall back to anonymous
  • update Redis Pulumi capacity settings and add coverage for the auth session config and boot refresh behavior

Verification

  • pnpm run lint
  • NODE_ENV=test npx jest tests/routes/betterAuth.ts --testEnvironment=node --runInBand
  • NODE_ENV=test npx jest tests/boot.ts --testEnvironment=node --runInBand
  • pnpm run build

@pulumi
Copy link
Copy Markdown

pulumi Bot commented Apr 13, 2026

🍹 The Update (preview) for dailydotdev/api/prod (at 87ba32c) was successful.

✨ Neo Explanation

This is a standard application deployment bumping all workloads to a new image tag, accompanied by a Redis instance memory doubling (1 GB → 2 GB) that will trigger a brief cache restart on GCP Memorystore. ✅ Low Risk (with a minor, expected Redis reconnect event during the resize).

This deployment rolls out a new application version (a68f129ca7746559) across all services, and includes a Redis memory upgrade.

The migration Jobs follow the standard pattern: old commit-stamped Jobs are deleted and new ones are created for the incoming commit, running both TypeORM DB migrations and Clickhouse migrations against the new image before traffic shifts.

🔵 Infoapi-redis is being scaled from 1 GB to 2 GB memory, with maxmemory-gb updated from 0.95 to 1.9 and the eviction policy remaining volatile-ttl. GCP Memorystore memory resizes on the BASIC tier require an instance restart, which will cause a brief Redis outage. Dependent services should reconnect automatically, but expect a short cache miss spike during the restart window.

Resource Changes

    Name                                                       Type                             Operation
~   vpc-native-deployment                                      kubernetes:apps/v1:Deployment    update
~   vpc-native-user-posts-analytics-refresh-cron               kubernetes:batch/v1:CronJob      update
~   vpc-native-rotate-daily-quests-cron                        kubernetes:batch/v1:CronJob      update
~   vpc-native-clean-stale-user-transactions-cron              kubernetes:batch/v1:CronJob      update
~   vpc-native-temporal-deployment                             kubernetes:apps/v1:Deployment    update
~   vpc-native-bg-deployment                                   kubernetes:apps/v1:Deployment    update
~   vpc-native-post-analytics-clickhouse-cron                  kubernetes:batch/v1:CronJob      update
~   vpc-native-user-profile-updated-sync-cron                  kubernetes:batch/v1:CronJob      update
~   vpc-native-clean-zombie-user-companies-cron                kubernetes:batch/v1:CronJob      update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob      update
~   vpc-native-update-trending-cron                            kubernetes:batch/v1:CronJob      update
~   vpc-native-update-tag-materialized-views-cron              kubernetes:batch/v1:CronJob      update
~   vpc-native-materialize-monthly-best-post-archives-cron     kubernetes:batch/v1:CronJob      update
~   vpc-native-user-profile-analytics-clickhouse-cron          kubernetes:batch/v1:CronJob      update
~   vpc-native-sync-subscription-with-cio-cron                 kubernetes:batch/v1:CronJob      update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob      update
~   vpc-native-update-achievement-rarity-cron                  kubernetes:batch/v1:CronJob      update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob      update
~   vpc-native-update-current-streak-cron                      kubernetes:batch/v1:CronJob      update
+   vpc-native-api-db-migration-a7746559                       kubernetes:batch/v1:Job          create
~   vpc-native-clean-expired-better-auth-sessions-cron         kubernetes:batch/v1:CronJob      update
~   vpc-native-personalized-digest-deployment                  kubernetes:apps/v1:Deployment    update
-   vpc-native-api-clickhouse-migration-a68f129c               kubernetes:batch/v1:Job          delete
~   vpc-native-channel-digests-cron                            kubernetes:batch/v1:CronJob      update
+   vpc-native-api-clickhouse-migration-a7746559               kubernetes:batch/v1:Job          create
~   vpc-native-squad-posts-analytics-refresh-cron              kubernetes:batch/v1:CronJob      update
~   vpc-native-clean-channel-highlights-cron                   kubernetes:batch/v1:CronJob      update
~   api-redis                                                  gcp:redis/instance:Instance      update
~   vpc-native-hourly-notification-cron                        kubernetes:batch/v1:CronJob      update
~   vpc-native-ws-deployment                                   kubernetes:apps/v1:Deployment    update
~   vpc-native-calculate-top-readers-cron                      kubernetes:batch/v1:CronJob      update
~   vpc-native-worker-job-deployment                           kubernetes:apps/v1:Deployment    update
~   vpc-native-clean-zombie-opportunities-cron                 kubernetes:batch/v1:CronJob      update
-   vpc-native-api-db-migration-a68f129c                       kubernetes:batch/v1:Job          delete
~   vpc-native-validate-active-users-cron                      kubernetes:batch/v1:CronJob      update
~   vpc-native-clean-zombie-users-cron                         kubernetes:batch/v1:CronJob      update
~   vpc-native-update-tags-str-cron                            kubernetes:batch/v1:CronJob      update
~   api-redis                                                  dailydotdev:pulumi-common:Redis  update
~   vpc-native-update-source-public-threshold-cron             kubernetes:batch/v1:CronJob      update
~   vpc-native-materialize-yearly-best-post-archives-cron      kubernetes:batch/v1:CronJob      update
~   vpc-native-generic-referral-reminder-cron                  kubernetes:batch/v1:CronJob      update
... and 13 other changes

@idoshamun idoshamun merged commit b98ff5a into main Apr 13, 2026
11 checks passed
@idoshamun idoshamun deleted the codex/auth-session-persistence-fixes branch April 13, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants